package com.szqhyxj.youxiangju.sys.components;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;

import com.szqhyxj.youxiangju.R;

/**
 * XiaoPanYu
 * on 2018/10/27
 */
public class ChoiceReceivablePopView extends BaseDialog{
    private Button cancel;
    private Button confirm;

    private String title;
    private OnClickListener listener;
    private int resource ;
    public ChoiceReceivablePopView(Context context){
        super(context);
    }

    public ChoiceReceivablePopView(Context context, int resource){
        super(context);
        this.resource = resource;
    }

    @Override
    protected View initDialogView(Context context){
        View view = LayoutInflater.from(context).inflate(R.layout.popview_receivables, null);
        cancel = view.findViewById(R.id.btn_cancel);
        cancel.setOnClickListener(this);

        confirm = view.findViewById(R.id.btn_confirm);
        confirm.setOnClickListener(this);
        return view;
    }



    @Override
    public void onClick(View v){
        super.onClick(v);
        switch(v.getId()){
            case R.id.btn_cancel:
                dismiss();
                break;

             case R.id.btn_confirm:
                if(listener!=null){
                    listener.onClickConfirm(v);
                }
        }
    }

    public interface OnClickListener {
        void onClickConfirm(View v);
    }


    public void setOnClickListener(OnClickListener listener){
        this.listener = listener;
    }
}



